﻿//https://leetcode.cn/problems/jewels-and-stones/

class Solution {
public:
    int numJewelsInStones(string jewels, string stones)
    {
        int hash[128] = { 0 };
        int ret = 0;
        for (auto& e : jewels)
        {
            hash[e]++;
        }

        for (auto& x : stones)
        {
            if (hash[x])
                ret++;
        }
        return ret;
    }
};